package com.fy.tt.entity;

import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
import java.sql.ResultSet;

@Data
@NoArgsConstructor
@Table(name = "bls_parser")
public class Parser {
    //    @TableId(value = "id", type = IdType.AUTO)
    @Id
    @Column(name = "id")
    private Long id;

    //    @ApiModelProperty(value = "帮区词汇集合更新时间")
    @Column(name = "words_update_time")
    private Date wordsUpdateTime;

    //    @ApiModelProperty(value = "剧本解析树更新时间")
    @Column(name = "parse_update_time")
    private Date parseUpdateTime;

    //    @ApiModelProperty(value = "帮语网站业务场景图标")
    @Column(name = "avatar")
    private String avatar;

    //    @ApiModelProperty(value = "业务场景名称")
    @Column(name = "band_name")
    private String bandName;

    //    @ApiModelProperty(value = "所属场景区id（ObjBandID），为0时代表通用解释器")
    @Column(name = "band_obj_id")
    private Long bandObjId;

    public Parser(ResultSet rs) {
        try {
            this.id = rs.getLong("id");
            this.wordsUpdateTime = rs.getTimestamp("words_update_time");
            this.parseUpdateTime = rs.getTimestamp("parse_update_time") ;
            this.avatar = rs.getString("avatar") ;
            this.bandName = rs.getString("band_name");
            this.bandObjId = rs.getLong("band_obj_id");
        }catch (Exception e){
            System.out.println(e.getCause());
        }
    }
}
